package mysqlConnection.test;

import java.sql.*;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args)throws Exception {
		// connection to the database
		Class.forName("com.mysql.jdbc.Driver");
		Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/employee_record","root","");
		PreparedStatement statement = con.prepareStatement("select * from employee");
		ResultSet result = statement.executeQuery();
	
		// take result and print to screen
		while(result.next()) {
			System.out.println(result.getString(1)+" "+result.getString(2));
		}

	}
	
}
